<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            border: 1px solid #000;
            width: 800px;
            height: 150px;
        }
        /* box下的2个亲儿子div */
        .box > div{
            height: 150px;
            width: 150px;
        }
        .left{
            background-color: hotpink;
            float: left;
        }
        .right{
            background-color: greenyellow;
            float: right;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="left"></div>
        <div class="right"></div>
    </div>
</body>
</html>